A database is any collection of information (data), typically structured so as to be searchable by one or more criteria. Database replication involves duplicating the data found in a first database to at least one other database, so that in the event the first database is corrupted, inaccessible, or destroyed, one of the other databases may operate as a replacement. The first database is referred to as the primary database, and the other databases may be referred to as backup databases.
Database replication is characterized by coherency, availability, and load balance. Two databases are said to be highly coherent when changes to one are quickly reflected into the other. The longer it takes for changes to one database to be reflected into the other, the less coherent the databases. A database is said to be highly available when attempts to access the data for reading and writing are successful a large majority of the time. The more often an access to a database fails, the less accessible the database. Load balancing is the process of balancing read/write accesses among multiple replicated databases. Two or more databases are said to be highly balanced when each experiences approximately the same number of accesses per unit time as each of the others.
Database replication may be performed synchronously or asynchronously. Synchronous replication involves replication that takes place closely in time with the transaction that is replicated. For example, if a write transaction is made to a first database and the data that was written is then replicated to a second database a few milliseconds later, the replication would typically be considered synchronous. Synchronous replication typically offers higher coherency, but lower availability, due to the fact that all of the backup databases incur the overhead of each individual write transaction to the primary database. Asynchronous replication typically involves a greater time delay between transactions to the primary database and replication to the backup databases. Transactions may be replicated in batches, so that the backup databases do not incur the overhead of every write transaction to the primary databases. Asynchronous replication offers higher availability at the expense of coherency.
Existing database replication methods include storage-level replication, database-level replication, and application-level replication. Storage-level replication involves actions to replicate the database by the device that stores the database information. Such devices may include intelligent disk arrays. Database-level replication involves actions to replicate the database by the database software that manages the database information. Such applications and produced and sold by such companies as Oracle, IBM, and Microsoft. Application-level replication involves actions to replicate the database by applications that access and/or operate upon the database information. Conventional replication techniques at the storage, database, and application level are either synchronous or asynchronous, but not both. Thus, the advantages of synchronous replication may be lost in situations where asynchronous replication is employed but where synchronous replication would be more advantageous. Likewise, the advantages of asynchronous replication may be lost in situations where synchronous replication is employed but where asynchronous replication would be more advantageous.